package com.riteny.oauth.core.userauth;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;

import java.util.Collection;

/**
 * @author Riteny
 * 2021/5/10  15:24
 */
public class CustomUser extends User {

    private String userType;

    public CustomUser(String username, String password, String userType, Collection<? extends GrantedAuthority> authorities) {
        super(username, password, authorities);
        this.userType = userType;
    }

    public String getUserType() {
        return userType;
    }

    public CustomUser withUserType(String userType) {
        this.userType = userType;
        return this;
    }
}
